/*----------------------------------------------------------------------------
 *      RL-ARM - RTX
 *----------------------------------------------------------------------------
 *      Name:    RTX_EX1.C
 *      Purpose: Your First RTX example program
 *----------------------------------------------------------------------------
 *      This code is part of the RealView Run-Time Library.
 *      Copyright (c) 2004-2013 KEIL - An ARM Company. All rights reserved.
 *---------------------------------------------------------------------------*/

//#include <RTL.h>                      /* RTX kernel functions & defines      */
#include "os.h"
#include "string.h"

#ifdef WIN32
#include "shell.h"
#include "stdio.h"
#endif

/*----------------------------------------------------------------------------
 *   uart
 *---------------------------------------------------------------------------*/
U64 stk_UART[512/8];
 void task_UART(void)
{
	int count = 0;
	for(;;){
		count++;
		tsleep(100);
	}
}

 /*----------------------------------------------------------------------------
 *   ???? ,????
 *---------------------------------------------------------------------------*/
//#pragma arm section rwdata = "SRAM",zidata = "SRAM"	 
		U64 stk_collect[512/8];
//#pragma arm section

 void tsk_Collect(void);

/*----------------------------------------------------------------------------
 *   init
 *---------------------------------------------------------------------------*/
//#pragma arm section rwdata = "SRAM",zidata = "SRAM"	 
		U64 stk_init[512/8];
//#pragma arm section
		
 void task_init (void)
{
	os_task_create_user(task_UART,23,stk_UART,sizeof(stk_UART));
	for(;;)
	{
		tsleep(1000);
	}
}




/*----------------------------------------------------------------------------
 *        Main: Initialize and start RTX Kernel
 *---------------------------------------------------------------------------*/

int main (void) {

#ifdef WIN32
	extern void InitConsoleWindow(void);
	extern void HideConsoleWindow(void);
	//??Console??????
	InitConsoleWindow();
	HideConsoleWindow();
	
#endif

	//gt_dev_init();
	os_task_create_user(task_init,0,stk_init,sizeof(stk_init));
	//#include "rtl.h"
	//os_sys_init (task_init);
#ifdef WIN32
	finsh_system_init();
#endif
	
	return 0;

}

/*----------------------------------------------------------------------------
 * end of file
 *---------------------------------------------------------------------------*/


